package bookdata;

import java.util.Objects;

public class BookData {
    private String bookid;
    private String bookname;
    private String author;
    private String press;

    public BookData(String bookid, String bookname, String author, String press) {
        this.bookid=bookid;
        this.bookname=bookname;
        this.author=author;
        this.press=press;
    }

    @Override
    public String toString() {
        return
                "图书号:" + bookid  +
                "  图书名:" + bookname  +
                "  作者:" + author +
                "  出版社:" + press ;

    }

    public String getBookid() {
        return bookid;
    }

    public void setBookid(String bookid) {
        this.bookid = bookid;
    }

    public String getBookname() {
        return bookname;
    }

    public void setBookname(String bookname) {
        this.bookname = bookname;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getPress() {
        return press;
    }

    public void setPress(String press) {
        this.press = press;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BookData bookData = (BookData) o;
        return Objects.equals(bookid, bookData.bookid);
                
    }

    @Override
    public int hashCode() {
        return Objects.hash(bookid);
    }
}
